﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public delegate void CallbackNumberBox(NumberBox num);
public class NumberBox : MonoBehaviour
{
    public CallbackNumberBox CallbackNumberBoxClicked;
    public Text m_NumberL;
    public Image m_Background;
    public int Number {
        get { return m_Number; }
        set
        {
            m_Number = value;
            m_NumberL.text = m_Number.ToString();
        }
    }
    int m_Number = 0;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {

    }
    public void SetTextColor(Vector4 color)
    {
        m_NumberL.color = color;
    }
    public void SetBackColor(Vector4 color)
    {
        m_Background.color = color;
    }

    public void OnClicked()
    {
        if (CallbackNumberBoxClicked != null)
            CallbackNumberBoxClicked(this);
    }
}
